// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')

module.exports = {

    build: {
        env: require('./prod.env'),
        index: path.resolve(__dirname, '../dist/index.html'),
        assetsRoot: path.resolve(__dirname, '../dist'),
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        productionSourceMap: false,
        // Gzip off by default as many popular static hosts such as
        productionGzip: true,
        productionGzipExtensions: ['js', 'css'],
        bundleAnalyzerReport: process.env.npm_config_report
    },
    dev: {
        env: require('./dev.env'),
        port: 80,
        autoOpenBrowser: true,
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        proxyTable: {
            '/api': {
                target: 'http://localhost:9701',
                secure: false,
                changeOrigin: true, // 如果接口跨域，需要进行这个参数配置,
                pathRewrite: {
                    '^/api': '/api'  // '^/attend': '/attend'
                }
            },
            '/third': {
                target: 'http://localhost:9701',
                secure: false,
                changeOrigin: true, // 如果接口跨域，需要进行这个参数配置,auth
                pathRewrite: {
                    '^/third': '/third'  // '^/attend': '/attend'
                }
            },
            '/platform': {
                target: 'http://localhost:9701',
                secure: false,
                changeOrigin: true, // 如果接口跨域，需要进行这个参数配置,
                pathRewrite: {
                    '^/platform': '/platform'  // '^/attend': '/attend'
                }
            },
            '/ruoyi': {
                target: 'http://localhost:9800/ruoyi-attend/attend',
                secure: false,
                changeOrigin: true, // 如果接口跨域，需要进行这个参数配置,
                pathRewrite: {
                    '^/ruoyi': '/'
                }
            }
        },
        // CSS Sourcemaps off by default because relative paths are "buggy"
        cssSourceMap: false
    }
}
